//
//  NSMutableAttributedString+Fstr.m
//  CloudCar
//
//  Created by TNG on 2018/1/8.
//  Copyright © 2018年 Tng. All rights reserved.
//

#import "NSMutableAttributedString+Fstr.h"

@implementation NSMutableAttributedString (Fstr)

+(NSMutableAttributedString *)headStr:(NSString *)headStr AndMiddleStr:(NSString *)middleStr AndFootStr:(NSString *)footStr AndFont:(UIFont *)font AndTextColor:(UIColor *)textColor
{
    NSString * str = [NSString stringWithFormat:@"%@%@%@",headStr,middleStr,footStr];
    NSMutableAttributedString * attributeStr =[[NSMutableAttributedString alloc]initWithString:str];
    [attributeStr addAttribute:NSAttachmentAttributeName value:font range:NSMakeRange(headStr.length, middleStr.length)];
    [attributeStr addAttribute:NSForegroundColorAttributeName value:textColor range:NSMakeRange(headStr.length, middleStr.length)];
    return attributeStr;
}

@end
